﻿#ifndef DIALOG_SETTHERMOSTAT_H
#define DIALOG_SETTHERMOSTAT_H

#include <qdialog.h>
#include "ObjAutoInject.h"

namespace Ui {
  class Dialog_SetThermostat;
}

class LineEdit_ThermostatRate;
class LineEdit_ThermostatTemperature;
class DeviceInfoManager;
class Dialog_SetThermostat : public QDialog,public ObjAutoInject
{
  Q_OBJECT
private://ui
  Ui::Dialog_SetThermostat *ui;
private://property
  uint deviceId=0;
  LineEdit_ThermostatRate* lineEdit_ThermostatRate=Q_NULLPTR;
  LineEdit_ThermostatTemperature* lineEdit_ThermostatTemperature=Q_NULLPTR;
private://dependency
  DeviceInfoManager* deviceInfoManager=Q_NULLPTR;
public:
  explicit Dialog_SetThermostat(QWidget *parent = nullptr);
  virtual ~Dialog_SetThermostat();
public:
  float getTemperature();
  float getRate();
public slots:
  virtual int exec() override;
protected slots:
  virtual void accept() override;
  virtual void reject() override;
private slots:
  void slot_updateThermostatInfo();
public://geter and seter
  uint getDeviceId();
  Dialog_SetThermostat* setDeviceId(uint deviceId);
  DeviceInfoManager* getDeviceInfoManager()const;
  Dialog_SetThermostat* setDeviceInfoManager(DeviceInfoManager* const deviceInfoManager);
public:
  virtual void objectAutoInjection(QHash<QString,QObject*>* objMap)override;
};

#endif // DIALOG_SETTHERMOSTAT_H
